﻿<%@ Page Language="C#" AutoEventWireup="true"  masterpagefile="~/Admin/Main.master" title="管理员管理"  CodeFile="ManagerList.aspx.cs" Inherits="Admin_ManagerList" %>

<asp:Content ID="Content1" ContentPlaceHolderID="LeftMenu" Runat="Server">
    <div class="leftMenuTitle">
        安全设置
    </div>
    <ul class="leftMenu">
        <li><a href="ChangeMyInformation.aspx">我的资料</a></li>
        <li><a href="ManagerAdd.aspx">管理员管理</a></li>
        <li><a href="SysLog.aspx">系统日志</a></li>
    </ul>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MidContent" Runat="Server">
  <div id="mainMenu">
  	<ul>
		<li><a href="ManagerAdd.aspx">添加管理员</a></li>
		<li><a href="ManagerList.aspx">管理员列表</a></li>
		<li><a href="ManagerRole.aspx">管理员组</a></li>
		<li><a href="ManagerRoleEdit.aspx">组权限定义</a></li>
	</ul>
  </div>
   <div id="main">
   <asp:Label id="Msg" runat="server" Text="" CssClass="msg" Visible="False"></asp:Label>
    <asp:GridView ID="ManagerList" runat="server" AllowPaging="True" AutoGenerateColumns="False" OnPageIndexChanging="ManagerList_PageIndexChanging" DataKeyNames="ManagerId" OnRowCancelingEdit="ManagerList_RowCancelingEdit" OnRowEditing="ManagerList_RowEditing" OnRowUpdating="ManagerList_RowUpdating" PageSize="11" OnRowDeleting="ManagerList_RowDeleting" CellPadding="0" CssClass="gv" Width="100%" OnRowDataBound="ManagerList_RowDataBound">
        <Columns>
            <asp:BoundField DataField="ManagerId" FooterText="Id" HeaderText="Id" ReadOnly="True" />
            <asp:BoundField DataField="ManagerName" HeaderText="用户名" SortExpression="ManagerName" ReadOnly="True" />
            <asp:TemplateField HeaderText="密码" SortExpression="Password">
                <EditItemTemplate>
                    <asp:TextBox ID="ChangPassword" runat="server"></asp:TextBox>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="ChangPassword"
                        Display="Dynamic" ErrorMessage="密码至少六位" ValidationExpression="\w{6,32}"></asp:RegularExpressionValidator>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label1" runat="server" Text='<%# Bind("Password", "******") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="PenName" HeaderText="笔名" SortExpression="PenName" />
            <asp:TemplateField HeaderText="所属管理员组"  SortExpression="MemberId">
                <EditItemTemplate>
                    <asp:CheckBoxList ID="ManagerRoleIdList" CssClass="checkBox" runat="server" >
                    </asp:CheckBoxList>
                    <asp:HiddenField ID="RoleIdHiddenField" Value='<%# Bind("RoleId") %>' runat="server" />
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:CheckBoxList ID="ManagerRoleIdList" CssClass="checkBox" runat="server" Enabled="False" >
                    </asp:CheckBoxList>
                    <asp:HiddenField ID="RoleIdHiddenField" Value='<%# Bind("RoleId") %>' runat="server" />
                </ItemTemplate>
                <ItemStyle HorizontalAlign="Left" />
            </asp:TemplateField>
            <asp:BoundField DataField="LoginUrl" HeaderText="登录后地址" SortExpression="LoginUrl" />
            <asp:BoundField DataField="AddTime" HeaderText="添加时间" ReadOnly="True" />
            <asp:BoundField DataField="UpTime" HeaderText="更新时间" ReadOnly="True" />
            <asp:TemplateField HeaderText="操作" ShowHeader="False">
                <EditItemTemplate>
                    <asp:Button ID="UpdateBt" runat="server" CausesValidation="True" CommandName="Update"
                        Text="更新" />
                    <asp:Button ID="CancelBt" runat="server" CausesValidation="False" CommandName="Cancel"
                        Text="取消" />    
                </EditItemTemplate>
                <ItemStyle CssClass="gvCommandField" />
                <ItemTemplate>
                    <asp:Button ID="EditBt" runat="server" Text="编辑" CausesValidation="false" CommandName="Edit" />
                    <asp:Button ID="DelBt" runat="server" CausesValidation="False" CommandName="Delete" Text="删除" />
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
        <RowStyle CssClass="gvRow" />
        <EditRowStyle CssClass="gvEditRow" />
        <PagerStyle CssClass="gvPage" />
        <HeaderStyle CssClass="gvHeader" />
        <AlternatingRowStyle CssClass="gvAlternatingRow" />
    </asp:GridView>
  </div>
  <script language="JavaScript" type="text/javascript" >
        topMenuThisPage(4);//当前位置顶部菜单标识
        leftMenuThisPage(1,2);//当前位置左侧菜单标识
        mainMenuThisPage(2);//当前选项卡标识
  </script>
</asp:Content>